/**
 * Copyright (c) 2020-Now http://www.future.com All rights reserved.
 */

 'use strict'

const port = process.env.port || process.env.npm_config_port || 8097 // 端口
const TransformPages = require('uni-read-pages')
const {webpack} = new TransformPages()
 // vue.config.js 配置说明
 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
 // 这里只列一部分，具体配置参考文档
 module.exports = {
   // webpack-dev-server 相关配置
   devServer: {
     host: '0.0.0.0',
     port: port,
     open: false,
     disableHostCheck: true
   },
   transpileDependencies: ['uview-ui'],
   configureWebpack: {
		plugins: [
			new webpack.DefinePlugin({
				ROUTES: webpack.DefinePlugin.runtimeValue(() => {
					const tfPages = new TransformPages({
						includes: ['path', 'name', 'meta','aliasPath']
					});
					return JSON.stringify(tfPages.routes)
				}, true )
			})
		]
	}
 }

